package cn.edu.xmu.orderpayment.payment.model.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@NoArgsConstructor//无参构造
@AllArgsConstructor//全参数的构造
public class PrePaymentVo {//implements VoObject {
    @ApiModelProperty(value = "支付id")
    private Long id;

    @ApiModelProperty(value = "交易流水号")
    private String tradeSn;

    @ApiModelProperty(value = "支付渠道id")
    private Long patternId;

    @ApiModelProperty(value = "支付金额")
    private Long amount;

    @ApiModelProperty(value = "单据id")
    private Long documentId;

    @ApiModelProperty(value = "单据类型")
    private Byte documentType;//0 订单，1 保证金，2 订单订金， 3 订单尾款

    @ApiModelProperty(value = "开始支付时间")
    private LocalDateTime beginTime;

    @ApiModelProperty(value = "支付截止时间")
    private LocalDateTime endTime;

    @ApiModelProperty(value = "微信prepaidId")
    private String prepaidId;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public LocalDateTime gmtCreate;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public LocalDateTime gmtModified;

//    public PrePaymentPo createPo(){
//        PrePaymentPo prePaymentPo = new PrePaymentPo();
//        prePaymentPo.setTradeSn(tradeSn);
//        prePaymentPo.setPatternId(patternId);
//        prePaymentPo.setAmount(amount);
//        prePaymentPo.setDocumentId(documentId);
//        prePaymentPo.setDocumentType(documentType);
//        prePaymentPo.setBeginTime(beginTime);
//        prePaymentPo.setEndTime(endTime);
//        prePaymentPo.setPrepaidId(prepaidId);
//        return prePaymentPo;
//    }
//
//    public PrePaymentVo(PrePaymentPo prePaymentPo){
//        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
//        id = prePaymentPo.getId();
//        tradeSn = prePaymentPo.getTradeSn();
//        patternId = prePaymentPo.getPatternId();
//        amount = prePaymentPo.getAmount();
//        documentId = prePaymentPo.getDocumentId();
//        documentType = prePaymentPo.getDocumentType();
//        prepaidId = prePaymentPo.getPrepaidId();
//        beginTime = prePaymentPo.getBeginTime();
//        endTime = prePaymentPo.getEndTime();
//        gmtCreate = prePaymentPo.getGmtCreate();
//        gmtModified = prePaymentPo.getGmtModified();
//    }
//
//    @Override
//    public Object createVo() {
//        return this;
//    }
//
//    @Override
//    public Object createSimpleVo() { return this; }

}
